# -*- coding:utf-8 -*-
# Created on 2017.3.12
# @author: hejia
# @Desc: ui demo

class UI(object):
    def __init__(self, *arg):
        print('python ui obj', arg)
        self.xx = 567

    def Start(self):
        print("UI.Start")
        self.install_events()

    def OnDestroy(self):
        pass

    def Update(self):
        print('python ui Update')
        print(self.xx)

    def OnGUI(self):
        pass

    def install_events(self):
        from event import KBEEvent

        # common
        KBEEvent.registerOut("onKicked", self.onKicked)
        KBEEvent.registerOut("onDisableConnect", self.onDisableConnect)
        KBEEvent.registerOut("onConnectStatus", self.onConnectStatus)

        # login
        KBEEvent.registerOut("onCreateAccountResult", self.onCreateAccountResult)
        KBEEvent.registerOut("onLoginFailed", self.onLoginFailed)
        KBEEvent.registerOut("onVersionNotMatch", self.onVersionNotMatch)
        KBEEvent.registerOut("onScriptVersionNotMatch", self.onScriptVersionNotMatch)
        KBEEvent.registerOut("onLoginBaseappFailed", self.onLoginBaseappFailed)
        KBEEvent.registerOut("onLoginSuccessfully", self.onLoginSuccessfully)
        KBEEvent.registerOut("onLoginBaseapp", self.onLoginBaseapp)
        KBEEvent.registerOut("Loginapp_importClientMessages", self.Loginapp_importClientMessages)
        KBEEvent.registerOut("Baseapp_importClientMessages", self.Baseapp_importClientMessages)
        KBEEvent.registerOut("Baseapp_importClientEntityDef", self.Baseapp_importClientEntityDef)

        # select-avatars(register by scripts)
        KBEEvent.registerOut("onReqAvatarList", self.onReqAvatarList)
        KBEEvent.registerOut("onCreateAvatarResult", self.onCreateAvatarResult)
        KBEEvent.registerOut("onRemoveAvatar", self.onRemoveAvatar)

    def onKicked(self):
        pass
    def onDisableConnect(self):
        pass
    def onConnectStatus(self):
        pass

        # login
    def onCreateAccountResult(self):
        pass
    def onLoginFailed(self):
        pass
    def onVersionNotMatch(self):
        pass
    def onScriptVersionNotMatch(self):
        pass
    def onLoginBaseappFailed(self):
        pass
    def onLoginSuccessfully(self):
        pass
    def onLoginBaseapp(self):
        pass
    def Loginapp_importClientMessages(self):
        pass
    def Baseapp_importClientMessages(self):
        pass
    def Baseapp_importClientEntityDef(self):
        pass

        # select-avatars(register by scripts)
    def onReqAvatarList(self):
        pass
    def onCreateAvatarResult(self):
        pass
    def onRemoveAvatar(self):
        pass
